package com.whitehot.klib.di.module;

import android.app.Application;

import com.google.gson.Gson;
import com.whitehot.klib.integration.IRepositoryManager;
import com.whitehot.klib.integration.RepositoryManager;
import com.whitehot.klib.utils.GsonFactory;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;


@Module
public class AppModule
{

    private Application mApplication;

    public AppModule(Application application)
    {
        this.mApplication = application;
    }

    @Singleton
    @Provides
    public Application provideApplication()
    {
        return mApplication;
    }

    @Singleton
    @Provides
    public Gson provideGson()
    {
        return GsonFactory.getGson();
    }

    @Singleton
    @Provides
    public IRepositoryManager provideRepositoryManager(RepositoryManager repositoryManager)
    {
        return repositoryManager;
    }
}
